template(name="swimlaneHeader")
  .swimlane-header-wrap.js-swimlane-header(class=colorClass title="{{_ 'rename'}}")
    if this.isTemplateContainer
        +swimlaneFixedHeader(this)
    else
      +inlinedForm
        +editSwimlaneTitleForm
      else
        +swimlaneFixedHeader(this)

template(name="swimlaneFixedHeader")
  .swimlane-header(
    class="{{#if currentUser.isBoardMember}}js-open-inlined-form is-editable{{/if}}")
      if $eq title 'Card Templates'
        | {{_ 'card-templates-swimlane'}}
      else if $eq title 'List Templates'
        | {{_ 'list-templates-swimlane'}}
      else if $eq title 'Board Templates'
        | {{_ 'board-templates-swimlane'}}
      else if $eq title 'Default'
        | {{_ 'defaultdefault'}}
      else
        +viewer
          | {{isTitleDefault title}}
  .swimlane-header-menu
    unless currentUser.isCommentOnly
      a.fa.fa-plus.js-open-add-swimlane-menu.swimlane-header-plus-icon(title="{{_ 'add-swimlane'}}")
      a.fa.fa-navicon.js-open-swimlane-menu(title="{{_ 'swimlaneActionPopup-title'}}")
      //// TODO: Collapse Swimlane: make button working, etc.
      //unless collapsed
      //  a.js-collapse-swimlane(title="{{_ 'collapse'}}")
      //    i.fa.fa-arrow-down.swimlane-header-collapse-down
      //    i.fa.fa-arrow-up.swimlane-header-collapse-up
      //if collapsed
      //  a.js-collapse-swimlane(title="{{_ 'uncollapse'}}")
      //    i.fa.fa-arrow-up.swimlane-header-collapse-up
      //    i.fa.fa-arrow-down.swimlane-header-collapse-down
      unless isTouchScreen
        if isShowDesktopDragHandles
          a.swimlane-header-handle.handle.fa.fa-arrows.js-swimlane-header-handle
      if isTouchScreen
        a.swimlane-header-miniscreen-handle.handle.fa.fa-arrows.js-swimlane-header-handle

template(name="editSwimlaneTitleForm")
  .list-composer
    input.list-name-input.full-line(type="text" value="{{isTitleDefault title}}" autofocus)
    .edit-controls.clearfix
      button.primary.confirm(type="submit") {{_ 'save'}}
      a.fa.fa-times-thin.js-close-inlined-form

template(name="swimlaneActionPopup")
  unless currentUser.isCommentOnly
    ul.pop-over-list
       if currentUser.isBoardAdmin
         li: a.js-set-swimlane-color
          i.fa.fa-paint-brush
          | {{_ 'select-color'}}
       li: a.js-set-swimlane-height
        i.fa.fa-arrows-v
        |  {{_ 'set-swimlane-height'}}
    if currentUser.isBoardAdmin
      unless this.isTemplateContainer
        hr
        ul.pop-over-list
          li: a.js-close-swimlane
            i.fa.fa-arrow-right
            i.fa.fa-archive
            | {{_ 'archive-swimlane'}}
        ul.pop-over-list
          li: a.js-copy-swimlane
            i.fa.fa-copy
            | {{_ 'copy-swimlane'}}
        ul.pop-over-list
          li: a.js-move-swimlane
            i.fa.fa-arrow-up
            | {{_ 'move-swimlane'}}

template(name="swimlaneAddPopup")
  unless currentUser.isCommentOnly
    form
      input.swimlane-name-input.full-line(type="text" placeholder="{{_ 'add-swimlane'}}"
        autocomplete="off" autofocus)
      .edit-controls.clearfix
        button.primary.confirm(type="submit") {{_ 'add'}}
        unless currentBoard.isTemplatesBoard
          unless currentBoard.isTemplateBoard
            span.quiet
              | {{_ 'or'}}
              a.js-swimlane-template {{_ 'template'}}

template(name="setSwimlaneColorPopup")
  form.edit-label
    .palette-colors: each colors
      span.card-label.palette-color.js-palette-color(class="card-details-{{color}}")
        if(isSelected color)
          i.fa.fa-check
    button.primary.confirm.js-submit {{_ 'save'}}
    button.js-remove-color.negate.wide.right {{_ 'unset-color'}}

template(name="setSwimlaneHeightPopup")
  #js-swimlane-height-edit
    label a) {{_ 'set-swimlane-height-value'}}
    label b) -1
      p
        input.swimlane-height-value(type="number" value="{{ swimlaneHeightValue }}" min="100")
        input.swimlane-height-apply(type="submit" value="{{_ 'apply'}}")
        input.swimlane-height-error

template(name="swimlaneHeightErrorPopup")
  .swimlane-height-invalid
    p {{_ 'swimlane-height-error-message'}} '&gt;=100'
    button.full.js-back-view(type="submit") {{_ 'cancel'}}

template(name="swimlaneDeletePopup")
  p {{_ "swimlane-delete-pop"}}
  button.js-confirm.negate.full(type="submit") {{_ 'delete'}}
